﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
namespace DataGridSample
{
    public class SelectItemModel<T> : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;


        private bool m_IsSelected;

        public bool IsSelected
        {
            get { return m_IsSelected; }
            set { m_IsSelected = value; IsSelectedChanged(); }
        }
        public void IsSelectedChanged()
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsSelected)));
        }
        private T m_Model;

        public T Model
        {
            get { return m_Model; }
            set { m_Model = value; }
        }
        public void ModelChanged()
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Model)));
        }
    }


    public class ItemModel
    {
        public string Text { get; set; }
    }
}
